import { clientRequest } from '../../request/client';

const api_name = '/api/user/userInfo'

/**
 * 客户端用户登录
 * 
 * @param loginParam 登录参数对象，包含用户名和密码
 */
export const ClientLogin = (loginParam: {
  username: string;
  password: string;
}) => {
  return clientRequest<Api.Auth.LoginToken>({
    url: `${api_name}/login`,
    method: 'post',
    data: loginParam
  });
}

/**
 * 获取客户端用户信息
 */
export const GetClientUserInfo = () => {
  return clientRequest<Api.Auth.UserInfo>({
    url: `${api_name}/info`,
    method: 'get'
  });
}

/**
 * 客户端用户退出登录
 */
export const ClientLogout = () => {
  return clientRequest({
    url: `${api_name}/logout`,
    method: 'get'
  });
}

